package com.driving.single.common.school.service.impl;

import com.driving.single.common.domain.TbSchoolClasses;
import com.driving.single.common.mapper.TbSchoolClassesMapper;
import com.driving.single.common.school.service.CommonSchoolClassesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
public class CommonSchoolClassesServiceImpl implements CommonSchoolClassesService {
    @Autowired
    private TbSchoolClassesMapper tbSchoolClassesMapper;
    @Override
    public List<TbSchoolClasses> selectSchoolClassesBySchoolId(Long schoolId) {
        Example example = new Example(TbSchoolClasses.class);
        example.setOrderByClause("`sort_order` ASC");
        example.createCriteria().andEqualTo("schoolId",schoolId);
        return this.tbSchoolClassesMapper.selectByExample(example);
    }
}
